package com.atao.baokede.service;


import com.atao.baokede.pojo.PageBean;
import com.atao.baokede.pojo.User;
import com.atao.baokede.pojo.UserOrder;
import jakarta.validation.Valid;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.Pattern;
import org.hibernate.validator.constraints.URL;

import java.math.BigDecimal;

public interface UserService {
    //用户注册
    void register(String username, String password,String email);

    //获取用户信息
    User getUserInfo();

    //更新用户基本信息
    void update(User user);

    //更新用户头像
    void updateAvatar(@URL String avatarUrl) throws Exception;

    //根据邮箱查询用户
    User findByUserEmail(@Valid @Email String email);

    //更新用户密码
    void updatePwd(String email,@Pattern(regexp = "^\\S{5,16}$") String newPwd);

    //减去用户余额
    void reduceBalance(Long userId, BigDecimal requestAmount);

    //获取用户信息
    User getUserInfoById(Long userId);

    //获取用户订单
    PageBean<UserOrder> getUserOrders(Integer status, Integer orderId, String item_name, Integer pageSize, Integer size);
}
